package com.zhuangjie.shop.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhaungjie.base.utils.LambdaStructureParser.LambdaStructureParser;
import com.zhuangjie.coupon.dto.QueryConfirmRequireDTO;
import com.zhuangjie.mvc.helper.GeoHelper.GeoCoordinates;
import com.zhuangjie.order.vo.ShopInfoForOrder;
import com.zhuangjie.shop.dto.FollowShopPageDTO;
import com.zhuangjie.shop.dto.SearchNearbyStoresPageDTO;
import com.zhuangjie.shop.dto.SettleInDTO;
import com.zhuangjie.shop.entity.Shop;
import com.zhuangjie.shop.enums.ShopInfoElementEnum;
import com.zhuangjie.shop.pojo.ShopBasicInfo;
import com.zhuangjie.shop.pojo.ShopBusinessConfig;
import com.zhuangjie.shop.vo.*;
import com.zhuangjie.shop.vo.order_confirm_require.OrderConfirmRequireVO;
import com.zhuangjie.shop.vo.predetermine.GeneratedPredetermineDayAndTimesInfo;
import com.zhuangjie.shop.vo.shop_display.NearbyShopVO;
import com.zhuangjie.shop.vo.shop_display.ShopSurfaceInfoVO;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * <p>
 * 商家/商店 服务类
 * </p>
 *
 * @author zhuangjie
 * @since 2023-09-24
 */
public interface ShopService extends IService<Shop> {

    void settleIn(SettleInDTO settleInDTO) throws Exception;

    void approveResidencyApplication(Long shopId);


    void changeShopStatus(Integer businessStatus);

    Integer getShopBusinessStatus(Long shopId) throws Exception;

    Page<NearbyShopVO> searchNearbyStores(SearchNearbyStoresPageDTO searchNearbyStoresPageDTO);

    ShopInfoVO getShopInfoById(Long shopId) throws ExecutionException, InterruptedException;


    ShopPredetermineInfo getShopBusinessInfo(Long shopId) throws ExecutionException, InterruptedException;

    ShopToUserDeliveryInfo getShopDeliveryInfoByUserGeoCoordinates(Long shopId, GeoCoordinates geoCoordinates);


    GeneratedPredetermineDayAndTimesInfo getShopBusinessDaysTimes(Long shopId, String receivingMethod, Long addressBookId) throws Exception;

    PredetermineDayAndTimeRangesForInternalUse getShopBusinessDaysTimeRangesForInternalUse(Long shopId, String receivingMethod, Long addressBookId) throws Exception;

    CreateOrderShopBasicInfo getCreateOrderBasicInfo(Long shopId);

    String getShopPhone(Long shopId);

    List<ShopInfoForOrder> getShopInfoListForOrder(List<String> ids);

    Map<Long, String> selectEarliestBookingTime(List<Long> ids);

    ShopForRider getShopAddress(Long shopId);

    ShopBasicInfo getShopBasicInfo();

    void updateShopBasicInfo(ShopBasicInfo shopBasicInfo);

    ShopBusinessConfigVO queryBusinessConfig();

    void updateBusinessConfig(ShopBusinessConfig shopBusinessConfig);

    ShopPreferentialLabelInfoVO queryPreferentialInfoByShopId(Long shopId) throws Exception;

    OrderConfirmRequireVO queryOrderConfirmRequire(QueryConfirmRequireDTO queryConfirmRequireDTO) throws ExecutionException, InterruptedException;

    List<ShopDisplayInfo> queryShopsDisplayInfo(List<Long> shopIds);

    Short queryShopDeliveryMethod(Long shopId);

    ShopForUserOrderMapVO selectShopInfoForUserOrderMap(Long shopId);

    <T> void shopInfoElementCollect(List<T> list, Map<ShopInfoElementEnum, LambdaStructureParser.NAHRFunction<T, Object>> shopInfoElementEnum);

    Page<ShopSurfaceInfoVO> followListPage(FollowShopPageDTO pageDTO);

}
